]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Workaround being allocated 0x0
authorColin Walters <walters@verbum.org>
Tue, 6 Oct 2009 18:07:40 +0000 (14:07 -0400)
committerColin Walters <walters@verbum.org>
Tue, 6 Oct 2009 19:12:20 +0000 (15:12 -0400)
Because of a chain of bugs we could end up getting allocated 0x0,
and this would cause the WellGrid allocation code to be unhappy.

See http://bugzilla.openedhand.com/show_bug.cgi?id=1831

Simply treat 0 as "unlimited" i.e. equivalent to -1.

https://bugzilla.gnome.org/show_bug.cgi?id=597586

js/ui/appDisplay.js

index 3e9a3bd70d6b17169bbf1ca3f2a8f8ff1ac0d155..85b6ee61fbad8d6993ff4eae76df1667d0f92964 100644 (file)
@@ -695,7 +695,10 @@ WellGrid.prototype = {
             return [0, WELL_DEFAULT_COLUMNS, 0, 0];
         let nColumns = 0;
         let usedWidth = 0;
-        if (forWidth < 0) {
+        // Big.Box will allocate us at 0x0 if we are not visible; this is probably a
+        // Big.Box bug but it can't be fixed because if children are skipped in allocate()
+        // Clutter gets confused (see http://bugzilla.openedhand.com/show_bug.cgi?id=1831)
+        if (forWidth <= 0) {
             nColumns = WELL_DEFAULT_COLUMNS;
         } else {
             while (nColumns < WELL_DEFAULT_COLUMNS &&
@@ -720,7 +723,7 @@ WellGrid.prototype = {
         let rows = Math.ceil(children.length / nColumns);
 
         let itemWidth;
-        if (forWidth < 0) {
+        if (forWidth <= 0) {
             itemWidth = itemNaturalWidth;
         } else {
             itemWidth = Math.floor(forWidth / nColumns);